<?php

// 定义程序目录
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

//加载配置文件config.ini
$iniArr = parse_ini_file(APPLICATION_PATH.'/configs/application.ini',true);
// 配置环境目录
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    realpath(APPLICATION_PATH . '/library'),
    realpath(APPLICATION_PATH . '/../../../library'),
    realpath(APPLICATION_PATH . '/modules'),
    realpath(APPLICATION_PATH . '/modules/default/controllers'),
    realpath(APPLICATION_PATH . '/modules/default/models'),
    realpath(APPLICATION_PATH . '/modules/userAndGroup/controllers'),
    realpath(APPLICATION_PATH . '/modules/userAndGroup/models'),
    get_include_path(),
)));

//定义默认时区
date_default_timezone_set('Asia/Shanghai');
require_once 'Zend/Loader/Autoloader.php';//载入zend框架
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);//静态载入自动类文件
/** Zend_Application */
require_once 'Zend/Application.php';

//开启session
Zend_Session::start();
// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
    ->run();
?>